From f4d68e0851f905829724c28a3567b583dd998a09 Mon Sep 17 00:00:00 2001 From: Martin Stjernholm Date: Mon, 10 Feb 2003 00:50:26 +0000 Subject: [PATCH] (c-set-offset): Don't find a default syntactic element through syntactic analysis if called outside a CC Mode buffer. --- lisp/progmodes/cc-styles.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lisp/progmodes/cc-styles.el b/lisp/progmodes/cc-styles.el index 4bd72f29070..c7f1adaa434 100644 --- a/lisp/progmodes/cc-styles.el +++ b/lisp/progmodes/cc-styles.el @@ -445,10 +445,11 @@ and exists only for compatibility reasons." ;; initial contents tries to be the last element ;; on the syntactic analysis list for the current ;; line - (let* ((syntax (c-guess-basic-syntax)) - (len (length syntax)) - (ic (format "%s" (car (nth (1- len) syntax))))) - (cons ic 0)) + (and c-buffer-is-cc-mode + (let* ((syntax (c-guess-basic-syntax)) + (len (length syntax)) + (ic (format "%s" (car (nth (1- len) syntax))))) + (cons ic 0))) ))) (offset (c-read-offset langelem))) (list langelem offset current-prefix-arg))) -- 2.30.2